#pragma once
#include <iostream>
#include "log.hpp"
#include <sys/types.h>
#include <sys/socket.h>



using namespace std;
Log log;
const int deafault_fd = -1;

enum{
    SOCK_CREAT_ERR
};
class TcpServer
{
public:
    TcpServer()
        :sockfd_(deafault_fd)
    {}


    void InitServer()
    {
        sockfd_ = socket(AF_INET, SOCK_STREAM, 0);//ipv4 、面向字节流、协议类型0
        if(sockfd_ < 0)
        {
            log(Fatal, "sockfd create error");
            exit(SOCK_CREAT_ERR);
        }
    }
    void RunServer()
    {

    }
    ~TcpServer()
    {}
private:
    int sockfd_;
};